import request from '@/utils/request'

export function adminUserList(data) {
  return request({
    url: '/backend/admin-user/list',
    method: 'get',
    params: data
  })
}

export function createAdminUser(data) {
  return request({
    url: '/backend/admin-user/create',
    method: 'post',
    data
  })
}

export function updateAdminUser(data) {
  return request({
    url: '/backend/admin-user/update',
    method: 'post',
    data
  })
}

export function deleteAdminUser(data) {
  return request({
    url: '/backend/admin-user/delete/' + data.id,
    method: 'get'
  })
}

export function assignRoles(data) {
  return request({
    url: '/backend/admin-user/assign-roles',
    method: 'post',
    data
  })
}

export function getUserMenus(userId) {
  return request({
    url: '/backend/admin-user/get-user-menus',
    method: 'get',
    params: { userId }
  })
}

export function getUserRoles(userId) {
  return request({
    url: '/backend/admin-user/get-user-roles',
    method: 'get',
    params: { userId }
  })
}
